package com.tadpole.music.holder.home;

import android.app.Activity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.tadpole.music.R;
import com.tadpole.music.bean.home.ClockInBean;
import com.tadpole.music.holder.base.BaseViewHolder;

import java.util.List;

/**
 * Created By 孙岩
 * on 2020/12/9
 */
public class DayViewHolder extends BaseViewHolder {
    private View itemView;
    private List<ClockInBean> list;
    private TextView tvWeek;
    private Activity activity;
    private ImageView fmBg;

    public DayViewHolder(Activity activity,View itemView,List<ClockInBean> list) {
        super(itemView);
        this.activity = activity;
        this.itemView = itemView;
        this.list = list;
    }

    @Override
    public void init(int position) {
        tvWeek = itemView.findViewById(R.id.tvWeek);
        fmBg = itemView.findViewById(R.id.fmBg);

        tvWeek.setText(list.get(position).getDay()+"");

        if(list.get(position).getDay()==0){
            tvWeek.setVisibility(View.GONE);
        }else{
            if(list.get(position).isClock()){
                fmBg.setVisibility(View.VISIBLE);
                tvWeek.setVisibility(View.GONE);
            }else{
                fmBg.setVisibility(View.GONE);
                tvWeek.setVisibility(View.VISIBLE);
            }
        }
    }
}
